home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.3 Development Libraries / SGI IRIX 6.3 Development Libraries.iso / dist / dist6.3 / ViewKit_dev.idb / usr / include / Vk / VkMoviePlayer.h.z / VkMoviePlayer.h
C/C++ Source or Header  |  1996-09-20  |  3KB  |  102 lines

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 1995, Silicon Graphics, Inc.   All Rights Reserved.
  4. //
  5. // This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6. // the contents of this file may not be disclosed to third parties, copied or
  7. // duplicated in any form, in whole or in part, without the prior written
  8. // permission of Silicon Graphics, Inc.
  9. //
  10. // RESTRICTED RIGHTS LEGEND:
  11. // Use, duplication or disclosure by the Government is subject to restrictions
  12. // as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13. // and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14. // successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15. // rights reserved under the Copyright Laws of the United States.
  16. //
  17. //////////////////////////////////////////////////////////////////////////////
  18.  
  19. #ifndef VKMOVIEPLAYER_H
  20. #define VKMOVIEPLAYER_H
  21.  
  22. // VkMoviePlayer.h
  23.  
  24. #include <Vk/VkComponent.h>
  25. #include <GL/glx.h>
  26.  
  27. class VkMoviePlayer : public VkComponent {
  28.  
  29.   public:
  30.  
  31.     static const char *const movieFinishedCallback;    
  32.  
  33.     VkMoviePlayer(const char * name,
  34.           Widget parent,
  35.                   char *movieFilename = NULL);
  36.  
  37.     virtual ~VkMoviePlayer();
  38.     virtual const char* className();
  39.  
  40.     void setMute (Boolean m=False);
  41.  
  42.     char*   movieFileName() const        { return _movieFileName; };
  43.     void    setMovieFileName(const char *);
  44.  
  45.     Boolean mpeg() const            { return _mpeg;          };
  46.     void *  movieId() const            { return _mvid;         };
  47.     void *  imageTrack() const            { return _imageTrack;    };
  48.     void *  audioTrack() const            { return _audioTrack;    };
  49.     pid_t   audioPid() const                    { return _audioPid;      };
  50.  
  51.     static VkComponent *CreateVkMoviePlayer(const char *, Widget);
  52.  
  53.     virtual void play();
  54.     virtual void play(Boolean);    
  55.     virtual void stop();
  56.     virtual void rewind();    
  57.     virtual void resize(Widget, XEvent*);
  58.     virtual void    drawFrame(int n = 0);
  59.     virtual void    playFrame();
  60.     virtual void    glInit(Widget);
  61.  
  62.     
  63.   private:
  64.  
  65.     static XtTranslations _tt;
  66.     static XtActionsRec   _actions[];
  67.     static char           _ttDraw[];
  68.     static String         _defaultResources[];
  69.  
  70.     Widget _form;
  71.     Boolean      _initialized, _muted, _playing, _mpeg;
  72.     Widget       _glDraw;
  73.     GLXContext   _glContext;
  74.  
  75.     char         *_movieFileName;
  76.     void *        _mvid, *_imageTrack, *_audioTrack;
  77.     int           _mvWidth, _mvHeight;
  78.     int           _totalFrames;
  79.     unsigned long _frameRateMS;
  80.     void*         _frame;
  81.     size_t        _frameSz;
  82.     int           _currentFrame;
  83.     pid_t         _audioPid;
  84.     XtIntervalId _intervalId;
  85.     
  86.  
  87.     Boolean build();
  88.  
  89.     void startTimer();
  90.     void stopTimer();
  91.  
  92.     // callbacks
  93.     
  94.     static void glInitCB(Widget, XtPointer, XtPointer);
  95.     static void exposedCB(Widget, XtPointer, XtPointer);
  96.     static void resizeCB(Widget, XtPointer,  XEvent*, Boolean*);    
  97.     static void intervalCB(XtPointer, XtIntervalId*);
  98.     static void *RegisterVkMoviePlayerInterface();        
  99. };
  100.  
  101. #endif
  102.